#ifndef _SORTLIB_H_
#define _SORTLIB_H_

//generics compare function
typedef int (* cel_compare_fn_t) (const void *,const void *);

//insetion sort.
void cel_subinsert_sort(void * a, unsigned int size, cel_compare_fn_t comp, unsigned int start, unsigned int end);
#define cel_insertion_sort(a, len, size, comp) cel_subinsert_sort(a, size, comp, 0, len - 1)
void cel_shell_sort(void * a, unsigned int length, unsigned int size, cel_compare_fn_t comp);
void cel_merge_sort(void * a, unsigned int length, unsigned int size, cel_compare_fn_t comp);
void cel_quick_sort(void * a, unsigned int length, unsigned int size, cel_compare_fn_t comp);
void cel_bucket_sort(unsigned int * a, unsigned int length, unsigned int bits);

#endif //_SORTLIB_H_
